package logic

import (
	"2207a/bawei/user_srv/models/redis"
	"context"

	"2207a/bawei/user_srv/internal/svc"
	"2207a/bawei/user_srv/user"

	"github.com/zeromicro/go-zero/core/logx"
)

type GetSendSmsLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewGetSendSmsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetSendSmsLogic {
	return &GetSendSmsLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *GetSendSmsLogic) GetSendSms(in *user.GetSendSmsRequest) (*user.GetSendSmsResponse, error) {
	// todo: add your logic here and delete this line
	code := redis.GetSendSms(in.Mobile, in.Source)
	return &user.GetSendSmsResponse{
		Code: code,
	}, nil
}
